<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org" >

<head>
    <meta http-equiv="Content-type" content="text/html; charset=UTF-8"/>
    <link type="text/css" rel="stylesheet" th:href="@{css/index.css}">
    <link type="text/css" rel="stylesheet" th:href="@{css/foot.css}">
    <link type="text/css" rel="stylesheet" th:href="@{css/head.css}">


    <meta http-equiv="Content-type" content="text/html; charset=UTF-8"/>
    <meta name="keywords" content="网上商城, 电商平台, 能源互联网">
    <meta name="description" content="能源互联网, 网上商城, 电商平台, 电子商务, 掌上e宝, 科技金服, 不正经网站研究中心">
    <title>网上商城-能源工业云平台_国电网商|网上金融科技|电子金服</title>
    <noscript>抱歉，你的浏览器不支持 JavaScript!</noscript>
    <script type="text/javascript" th:src="@{js/lib-v1.js}"></script>
    <script type="text/javascript" th:src="@{js/logout.js}"></script>
    <script type="text/javascript" th:src="@{js/jquery-extend.js}"></script>
    <script type="text/javascript" th:src="@{js/jquery.min.js}"></script>
    <script type="text/javascript" th:src="@{js/jquery.cookie.js}"></script>
    <script type="text/javascript" th:src="@{js/common.js}"></script>
    <script type="text/javascript" th:src="@{js/cookie.js}"></script>
    <script type="text/javascript" th:src="@{js/jquery.cookie.js}"></script>
    <script type="text/javascript" th:src="@{js/common.js}"></script>
    <script type="text/javascript" th:src="@{js/cookie.js}"></script>
    <script type="text/javascript" th:src="@{js/jquery-1.2.6.min.js}"></script>
    <script type="text/javascript" th:src="@{js/base-v1.js}"></script>
    <link type="text/css" rel="stylesheet" th:href="@{css/prodList.css}">
    <link rel="icon" type="image/x-icon" th:href="@{img/head/favicon.ico}"  />



    <link rel="stylesheet" type="text/css"  href="http://static.mayikt.com/swiper.min.css?t=e36c1b94-82c8-4c3a-9b03-536a1758ac42"/>

    <link rel="stylesheet" type="text/css" href="http://static.mayikt.com/new_file.css?t=e36c1b94-82c8-4c3a-9b03-536a1758ac42"/>

    <link rel="stylesheet" type="text/css"  href="http://static.mayikt.com/iconfont.css?t=e36c1b94-82c8-4c3a-9b03-536a1758ac42"/>

    <link rel="stylesheet" type="text/css"  href="http://static.mayikt.com/new_personal.css?t=e36c1b94-82c8-4c3a-9b03-536a1758ac42"/>

    <link rel="stylesheet" type="text/css" href="http://www.mayikt.com/static/css/index_css_2019_08_22_001.css?t=e36c1b94-82c8-4c3a-9b03-536a1758ac42"/>

    <link rel="stylesheet" type="text/css"  href="http://www.mayikt.com/static/css/index.css?t=e36c1b94-82c8-4c3a-9b03-536a1758ac42">
    <script src="http://www.mayikt.com/static/js/public-bombs.js?t=e36c1b94-82c8-4c3a-9b03-536a1758ac42"  type="text/javascript" charset="utf-8"></script>
    <script  src="http://static.mayikt.com/jquery-1.11.1.min.js?t=e36c1b94-82c8-4c3a-9b03-536a1758ac42" type="text/javascript" charset="utf-8"></script>
    <script  src="http://static.mayikt.com/jquery.SuperSlide.2.1.3.js?t=e36c1b94-82c8-4c3a-9b03-536a1758ac42" type="text/javascript" charset="utf-8"></script>
    <script  src="http://static.mayikt.com/swiper.min.js?t=e36c1b94-82c8-4c3a-9b03-536a1758ac42" type="text/javascript" charset="utf-8"></script>
    <script  src="http://static.mayikt.com/public-bomb-pc-index-2020-002.js?t=e36c1b94-82c8-4c3a-9b03-536a1758ac42" type="text/javascript" charset="utf-8"></script>
    <script  src="http://static.mayikt.com/PCindex2020-002.js?t=e36c1b94-82c8-4c3a-9b03-536a1758ac42" type="text/javascript" charset="utf-8"></script>

    <link href="https://s02.mifile.cn/assets/css/home.1f77b03c.css" rel="preload" as="style">
    <link href="https://s02.mifile.cn/assets/js/chunk-vendors.243ce88a.js" rel="preload" as="script">
    <link href="https://s02.mifile.cn/assets/js/home.866acb0e.js" rel="preload" as="script">
    <link href="https://s02.mifile.cn/assets/css/home.1f77b03c.css" rel="stylesheet">
    <meta charset="UTF-8">

</head>

<body>
<div id="common_head">
    <div class="line1">
        <div class="content">
            <ul>
                <li class="fore1" id="loginbar" clstag="homepage|keycount|home2013|01b">
                    <span id="head_span" >
                        <a href="login.html" id="login" >登录</a>&nbsp;&nbsp;|&nbsp;&nbsp;
                        <a href="regist.html">注册</a>

                    </span>
                </li>
            </ul>
        </div>
    </div>
    <div class="line2">
        <img id="logo" src="img/head/logo1.png" alt="logo"/>
        <input type="text"   id="name1" autocomplete="off"/>
        <input type="button" value="搜 索" onclick="suosuo()"/>
        <span id="goto">
			<a id="goto_order" href="./myorder.html">我的订单</a>
			<a id="goto_cart" href="./mycart.html">我的购物车</a>
		</span>
        <a href="myself.html">
            <img id="erwm" src="img/head/e2.png" alt="e2" width="76"  />
        </a>
    </div>
    <div class="line3">
        <div class="content">
            <ul>
                <li><a href="./index.html">首页</a></li>
                <li><a href="quanbu.html">全部商品</a></li>
                <li><a href="./instant-buy.html">秒杀商品</a></li>
                <li><a href="javascript:cah(1)">电脑平板</a></li>
                <li><a href="javascript:cah(2)">家用电器</a></li>
                <li><a href="javascript:cah(3)">汽车用品</a></li>
                <li><a href="javascript:cah(4)">食品饮料</a></li>
                <li><a href="javascript:cah(5)">图书杂志</a></li>
                <li><a href="javascript:cah(6)">服装服饰</a></li>
            </ul>
        </div>
    </div>
</div>
<script type="text/javascript">
    function cah(id){
        window.location.href="shop-1.html?id="+id;
    }

</script>

<div id="index">
    <section>

            <script type="text/javascript">
                function suosuo(){
                    var name = document.getElementById("name1").value;
                    getshop(name)
                }
                //轮播图前台
                window.onload= function () {
                    getBanner();
                    getshop();


                    var op= "";
                    var info="";
                    var  id=sessionStorage.getItem("name");
                    if(id !=null){

                        op+="      <font color='red'> 欢迎用户: "+id+" </font>\n" +
                            "  \ &nbsp;  || &nbsp;                    <a onclick=\"out()\">退出</a>&nbsp;&nbsp;&nbsp;&nbsp;"
                        $("#head_span").html(op);
                    }else{
                        info+="<a href=\"login.html\" id=\"login\"  >登录</a>\n " +
                            "&nbsp;  || &nbsp;           <a href=\"login1.html\">手机号登录</a>\n "+
                            "&nbsp;  || &nbsp;           <a href=\"regist.html\">注册</a>"
                        $("#head_span").html(info);
                    }


                }
                function  out(){
                    sessionStorage.clear("name");
                    location.href="index.html"
                }
                function getBanner(){

                    $.ajax({
                        url:"getBanner",
                        type:"post",
                        dataType: 'json',
                        success:function(data){
                            for(var i in data) {
                                $("#img_"+i).attr("src",data[i].img)
                            }

                        }
                    })

                }

            </script>
            <!--  购物车按钮-->
            <style>
                .button {
                    background-color: #4CAF50; /* Green */
                    border: none;
                    color: white;
                    padding: 0px 18px;
                    text-align: center;
                    text-decoration: none;
                    display: inline-block;
                    font-size: 6px;
                    margin: 4px 2px;
                    -webkit-transition-duration: 0.4s; /* Safari */
                    transition-duration: 0.4s;
                    cursor: pointer;
                }

                .button1 {
                    background-color: white;
                    color: black;
                    border: 2px solid #4CAF50;
                }

                .button1:hover {
                    background-color: #4CAF50;
                    color: white;
                }
            </style>

            <div class="container">
                <!-- 商品列表展示-->
                <ul  id="shangpin">

                </ul>
            </div>

            <script type="text/javascript">
                //商品展示
                function getshop(name) {

                    $.ajax({
                        url:"getPro1",
                        type:"get",
                        data:{name:name},
                        dataType: 'json',
                        success:function(data){
                            console.log(data)

                            var op = "";
                            for (var i = 0; i <data.length ; i++) {

                                var id = data[i].product_id
                                var sdf = data[i].product_description
                                var ad = sdf.slice(0,10);
                                op +="<li class=\"brick-item brick-item-m brick-item-m-2\">\n" +
                                    "                                        <a target='_blank' onclick='tiaozhuan("+id+")' >\n" +
                                    "                                            <div class=\"figure figure-img\">\n" +
                                    "                                                <img width='160' height='160'   src=\""+data[i].product_imgurl+"\" lazy=\"loading\">\n" +
                                    "                                            </div>\n" +
                                    "                                        </a>\n" +
                                    "                                            <h6 class=\"title\">"+data[i].product_name+"</h6>\n" +
                                    "                                            <p class=\"desc\">"+ad+"</p>\n" +
                                    "                                            <div align=\"center\">\n" +
                                    "                                                <button class=\"button button1\" onclick=\"addCart("+data[i].product_id+")\">添加购物车</button>\n" +
                                    "                                            </div>\n" +
                                    "                                            <p class=\"price\">\n" +
                                    "                                                <span class=\"num\">"+data[i].product_price+"</span>元<span>起</span>\n" +
                                    "                                            </p>\n" +
                                    "                                    </li>"
                            }

                            $("#shangpin").html(op);
                        }
                    })
                }

                function addCart(id){
                    $.ajax({
                        url:"cart/addCart",
                        data:{productId:id,num:1},
                        type:"post",
                        dataType:"json",
                        success:function (data){
                            alert("添加成功");
                        }
                    })
                }



                //商品id传到product-info.html页面
                function  tiaozhuan(id){
                    window.location.href  = "product-info.html?product_id=" + id;
                }
            </script>



            <div id="line4">
                <img src="img/index/217.jpg" alt="217"/>
            </div>


            <div id="line5">
			<span id="line5_1">
				<img src="img/index/icon_g1.png" alt="icon_g1"/>&nbsp;&nbsp;500强企业 品质保证
			</span>
                <span id="line5_2">
				<img src="img/index/icon_g2.png" alt="icon_g2"/>&nbsp;&nbsp;7天退货 15天换货
			</span>
                <span id="line5_3">
				<img src="img/index/icon_g3.png" alt="icon_g3"/>&nbsp;&nbsp;100元起免运费
			</span>
                <span id="line5_4">
				<img src="img/index/icon_g4.png" alt="icon_g4"/>&nbsp;&nbsp;448家维修网点 全国联保
			</span>
            </div>
        <div class="fixed">
            <a href="https://github.com/GoogleLLP/SuperMarket" target="_blank">
                <img src="./img/head/qr.jpg" width="100" alt="qrcode"/>
            </a>
            <a href="#common_head" class="toTop"></a>
        </div>
        <div id="common_foot">
            <p>
                Copyright © 2011-2019 网上商城 版权所有 保留一切权利 粤CM-20201119 | 粤ICP备20201119号-1
                <br />
                粤公网安备  20201119号
            </p>
        </div>
        <div>
        </div>

    </section>


</div>
</body>
</html>